<?php

/***************************************************************************************
 *                                                                                     *
 * This file is part of the XPertMailer package (http://xpertmailer.sourceforge.net/)  *
 *                                                                                     *
 * XPertMailer is free software; you can redistribute it and/or modify it under the    *
 * terms of the GNU General Public License as published by the Free Software           *
 * Foundation; either version 2 of the License, or (at your option) any later version. *
 *                                                                                     *
 * XPertMailer is distributed in the hope that it will be useful, but WITHOUT ANY      *
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A     *
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.           *
 *                                                                                     *
 * You should have received a copy of the GNU General Public License along with        *
 * XPertMailer; if not, write to the Free Software Foundation, Inc., 51 Franklin St,   *
 * Fifth Floor, Boston, MA  02110-1301  USA                                            *
 *                                                                                     *
 * XPertMailer SMTP & POP3 PHP Mail Client. Can send and read messages in MIME Format. *
 * Copyright (C) 2007  Tanase Laurentiu Iulian                                         *
 *                                                                                     *
 ***************************************************************************************/

/**
 Send an e-mail using a Relay SMTP Mail Server (Gmail on port 465 via SSL)
 - text message
 - html message
 - attachment inline (XPertMailer logo image)
 - print debug message
*/

require_once 'libraries/XPM3-V.0.3/XPM3_MAIL.php';


$id = XPM3_MIME::unique();

$m = new XPM3_MAIL;
$m->Relay('mail.harinath.in', 'testuser+harinath.in', 'password' , false) or die('Can\'t connect to Relay SMTP Mail Server !'); // or print_r($m->result);
$m->Delivery('relay');
$m->From('testuser@harinath.in', 'PHP SMTP Test mail');
$m->AddTo('testuser@harinath.in', 'To User'); //replace this user id with your user id to get mail
$m->Text('It is simple to use XPM3.'."\n\n".'Powered by XPertMailer');
$m->Html('It is simple to use <b>XPM3</b>.<br><br><i>Powered by</i> <img src="cid:'.$id.'">');
//$m->AttachFile($file, null, null, null, 'base64', 'inline', $id); // <- embed image in HTML
$m->Send('Hello World!'); // <- send mail
$m->Quit(); // <- quit from relay SMTP server
print_r($m->result); // <- for debugging

?>